/* 重载指针运算符：operator-> */

#include<iostream>
using namespace std;

struct InnerData
{
	int i;
	double d;
	float f;
	string s;

	InnerData(void) 
	: i{2019}, d{3.1415926}, f{2.71828f}, s{"hello, world"}
	{
	}
};

class Impl
{
public:
	InnerData* operator->()
	{
		return &d;
	}

private:
	InnerData d;
};

int main(void)
{

	Impl p;
	cout<< p->s <<endl;

	return 0;
}
